<%@page contentType="text/html" pageEncoding="UTF-8"%> 
<%@page import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<TABLE width="100%" border=0 cellSpacing=0 cellPadding=0 HEIGHT="100%" align=center>
		<TR>
			<TD width="150" height="50" align=center>
				<p>Hỗ trợ trực tuyến</p>
				<a href="ymsgr:sendIM?hoa176">
				<img src="http://opi.yahoo.com/online?u=hoa176&amp;m=g&amp;t=2" alt="đang tải..."/>
				</a>
			</TD>
		</TR>
		<TR >
			<TD width="150" Align=center vAlign="top" bgcolor="gray">
			<%
				Class.forName("com.mysql.jdbc.Driver");
				String link = "";
				Connection conR = null;
				Statement smtR = null;
				ResultSet rstR = null;
				StringBuffer tmp = new StringBuffer();
				try {
					String usernameR = "root";
					String passwordR = "root";
					String urlR = "jdbc:mysql://127.0.0.1:3306/laptop?useUnicode=true&characterEncoding=UTF-8";
					conR = DriverManager.getConnection(urlR, usernameR, passwordR);
					System.out.println("Da ket noi CSDL");
					smtR = conR.createStatement();
					rstR = smtR.executeQuery("select * from quangcao");
					rstR.next();
					link = request.getRealPath("/");
					for (int k = 0; k < link.length(); k++) {
						if (link.charAt(k) != '\\') tmp.append(link.charAt(k)); 
						else tmp.append('/');
					}
					link = rstR.getString("link");
					out.println(link);
                                        out.println("<img src='image/logo1.png' width=100% heigth=100% ");
					out.println("<object type='application/x-shockwave-flash' data='/Laptop/web/image/"+link+"' width='150' height='540'>");
					out.println("<param name='movie' value='/Laptop/web/image/"+link+"'/>");
					out.println("<param name='quality' value='high'/>");
					out.println("<param name='wmode' value='transparent'/></object>");
					conR.close();
					System.out.println("Dong ket noi");
				}
				catch (Exception e) {
					e.printStackTrace();
					System.out.println("KHONG KET NOI DUOC");
				}
			%>
			</TD>
		</TR>
	</TABLE>
</body>
</html>